# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-cytoolz
_pkgorig=cytoolz
pkgver=1.0.0
pkgrel=0
pkgdesc="Cython implementation of Toolz: High performance functional utilities"
url="https://github.com/pytoolz/cytoolz"
arch="all"
license="BSD-3-Clause"
depends="python3 cython py3-toolz"
checkdepends="py3-pytest"
makedepends="python3-dev py3-setuptools"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/c/cytoolz/cytoolz-$pkgver.tar.gz
	do-not-package-tests.patch"
builddir="$srcdir/$_pkgorig-$pkgver"

build() {
	# C extension
	python3 setup.py build_ext --inplace --with-cython

	# Python extension
	python3 setup.py build
}

check() {
	local python_version=$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
	export PYTHONPATH="build/lib.linux-$CARCH-$python_version/:$PYTHONPATH"
	echo "$PYTHONPATH"

	pytest -v
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"
}

sha512sums="
4edf016e8027c646d85170de418acedd4f254e8e684f249160e79c892d8cf19c6ab897f32e55a02d4b936c8a2e150ec27bde125336325a07af06d1715b4e1208  py3-cytoolz-1.0.0.tar.gz
d5a79048e053efccec379e73a185bd8002ad95246b696a8c612bbb849e2b55f1c06e203ccc164f25b9a9242515805590c26028da188ac789ffe965b5a7430707  do-not-package-tests.patch
"
